package pl.pawluk.inz.dto;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * User: mandp
 * Date: 19.04.13
 * Time: 22:14
 * To change this template use File | Settings | File Templates.
 */
public class CourseDTO extends BaseDTO {
    private Date start;
    private Date stop;
    private String name;


    public Date getStart() {
        return start;
    }

    public void setStart(Date start) {
        this.start = start;
    }

    public Date getStop() {
        return stop;
    }

    public void setStop(Date stop) {
        this.stop = stop;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof CourseDTO)) return false;

        CourseDTO courseDTO = (CourseDTO) o;

        if (name != null ? !name.equals(courseDTO.name) : courseDTO.name != null) return false;
        if (start != null ? !start.equals(courseDTO.start) : courseDTO.start != null) return false;
        if (stop != null ? !stop.equals(courseDTO.stop) : courseDTO.stop != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = start != null ? start.hashCode() : 0;
        result = 31 * result + (stop != null ? stop.hashCode() : 0);
        result = 31 * result + (name != null ? name.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "CourseDTO{" +
                "start=" + start +
                ", stop=" + stop +
                ", name='" + name + '\'' +
                '}';
    }
}
